package com.jiuqi.irs.generator.dao.pojo;

import java.io.Serializable;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

/** 
 *        @hibernate.class
 *         table="TB_ITEM"
 *     
*/
public class TbItem implements Serializable {

    /** identifier field */
    private String itemCode;

    /** persistent field */
    private String itemName;

    /** persistent field */
    private String itemYear;

    /** nullable persistent field */
    private String reserved1;

    /** nullable persistent field */
    private String reserved2;

    /** nullable persistent field */
    private String reserved3;

    /** full constructor */
    public TbItem(String itemCode, String itemName, String itemYear, String reserved1, String reserved2, String reserved3) {
        this.itemCode = itemCode;
        this.itemName = itemName;
        this.itemYear = itemYear;
        this.reserved1 = reserved1;
        this.reserved2 = reserved2;
        this.reserved3 = reserved3;
    }

    /** default constructor */
    public TbItem() {
    }

    /** minimal constructor */
    public TbItem(String itemCode, String itemName, String itemYear) {
        this.itemCode = itemCode;
        this.itemName = itemName;
        this.itemYear = itemYear;
    }

    /** 
     *            @hibernate.id
     *             generator-class="assigned"
     *             type="java.lang.String"
     *             column="ITEM_CODE"
     *         
     */
    public String getItemCode() {
        return this.itemCode;
    }

    public void setItemCode(String itemCode) {
        this.itemCode = itemCode;
    }

    /** 
     *            @hibernate.property
     *             column="ITEM_NAME"
     *             length="100"
     *             not-null="true"
     *         
     */
    public String getItemName() {
        return this.itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    /** 
     *            @hibernate.property
     *             column="ITEM_YEAR"
     *             length="4"
     *             not-null="true"
     *         
     */
    public String getItemYear() {
        return this.itemYear;
    }

    public void setItemYear(String itemYear) {
        this.itemYear = itemYear;
    }

    /** 
     *            @hibernate.property
     *             column="RESERVED1"
     *             length="50"
     *         
     */
    public String getReserved1() {
        return this.reserved1;
    }

    public void setReserved1(String reserved1) {
        this.reserved1 = reserved1;
    }

    /** 
     *            @hibernate.property
     *             column="RESERVED2"
     *             length="100"
     *         
     */
    public String getReserved2() {
        return this.reserved2;
    }

    public void setReserved2(String reserved2) {
        this.reserved2 = reserved2;
    }

    /** 
     *            @hibernate.property
     *             column="RESERVED3"
     *             length="150"
     *         
     */
    public String getReserved3() {
        return this.reserved3;
    }

    public void setReserved3(String reserved3) {
        this.reserved3 = reserved3;
    }

    public String toString() {
        return new ToStringBuilder(this)
            .append("itemCode", getItemCode())
            .toString();
    }

    public boolean equals(Object other) {
        if ( !(other instanceof TbItem) ) return false;
        TbItem castOther = (TbItem) other;
        return new EqualsBuilder()
            .append(this.getItemCode(), castOther.getItemCode())
            .isEquals();
    }

    public int hashCode() {
        return new HashCodeBuilder()
            .append(getItemCode())
            .toHashCode();
    }

}
